package com.zusmart.core.condition.extend;

import java.util.Map;

import com.zusmart.core.bean.BeanDefinition;
import com.zusmart.core.condition.Condition;
import com.zusmart.core.condition.ConditionContext;
import com.zusmart.core.config.ConfigSourceManager;
import com.zusmart.core.plugin.PluginManager;

public class ConditionalUnHasClassRule extends ConditionalOnHasClassRule implements Condition {

	@Override
	public boolean matches(ConditionContext conditionContext, Map<String, BeanDefinition> beanDefinitions, BeanDefinition targetBeanDefinition, PluginManager pluginManager, ConfigSourceManager configSourceManager) {
		ConditionalUnHasClass hasClass = (ConditionalUnHasClass) conditionContext.getExtendAnnotation();
		String clazz = hasClass.value();
		return !this.doMatches(conditionContext, beanDefinitions, targetBeanDefinition, clazz);
	}

}